import LoginComponent from "./account/LoginComponent";
import GlobalMonitoringComponent from "./global_monitoring/GlobalMonitoringComponent";
import ProductTestComponent from "./product_test/ProductTestComponent";
import CarManagerComponent from "./car_manager/CarManagerComponent";
import WarningManagerComponent from "./warning/WarningManagerComponent";
import OrganizationComponent from "./organization/OrganizationComponent";
import ChargeManagerComponent from "./charge/ChargeManagerConponent";
import HomeComponent from "./HomeComponent";
import Error404Component from "./404/Error404Component";


/**
 * <Route path={"/home/global_monitor"} component={GlobalMonitoringComponent}/>
 <Route path={"/home/product_test"} component={ProductTestComponent}/>
 <Route path={"/home/car_manager"} component={CarManagerComponent}/>
 <Route path={"/home/warning_manager"} component={WarningManagerComponent}/>
 <Route path={"/home/charge_manager"} component={ChargeManagerComponent}/>
 <Route path={"/home/organization_manager"} component={OrganizationComponent}/>
 * @type {*[]}
 */

const routers = [
    {
        path: "/login",
        component: LoginComponent,
    },
    {
        path: "/home",
        component: HomeComponent,
        routes: [
            {
                path: "/home/global_monitor",
                component: GlobalMonitoringComponent
            },
            {
                path: "/home/product_test",
                component: ProductTestComponent
            },
            {
                path: "/home/car_manager",
                component: CarManagerComponent
            },
            {
                path: "/home/warning_manager",
                component: WarningManagerComponent
            },
            {
                path: "/home/charge_manager",
                component: ChargeManagerComponent
            },
            {
                path: "/home/organization_manager",
                component: OrganizationComponent
            }
        ]
    },
    {
        path: "*",
        component: Error404Component,
    }
];

export default routers;

// export const RouteWithSubRoute = (route) => {
//
//     return (
//         <Route
//             path={route.path}
//             render={
//                 props => (
//                     <route.component {...props} routes={route.routes}/>
//                 )
//             }
//         />
//     );
// };

